import React, { Component, Fragment } from 'react';
import { Text } from 'react-native';

class BLink extends Component {
    constructor(props){
        super(props);
        this.state = {
            isShowingText: true
        }
    }

    componentDidMount(){
        setInterval(()=>{
            this.setState(prev => {
                return {isShowingText: !prev.isShowingText}
            })
        }, 1000)
    }

    render(){
        const {isShowingText} = this.state
        const {text} = this.props
        
        return (
            <Fragment>{isShowingText && <Text>{text}</Text>}</Fragment>
        )
    }
}

export default BLink;